<!DOCTYPE html>
<html lang="zh-cn" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<title th:text="|#{customer.systemTitle}-图灵谷-内容管理-TAG管理|">图灵谷</title>
<div th:replace="fragments/head_admin">head</div>
<!--/***** 当前页css  start *****/-->
<!--/***** 当前页css  end *****/-->
</head>
<body>
	<div class="layui-layout layui-layout-admin">
		<div th:replace="fragments/nav_admin">导航栏</div>
		<div th:replace="fragments/menu_admin::menu(parent=content,child=tag)">菜单栏</div>
		<!--/*******内容*******/-->
		<div class="layui-body">
			<div class="layui-main">
				<!--/***** 面包屑 *****/-->
				<div class="layui-elem-quote" style="margin-top: 10px;">
					<span class="layui-breadcrumb"> <a><cite>内容管理</cite></a><a th:href="@{/admin/m/base/tag/list.gsp}">TAG管理</a><a><cite>列表</cite></a>
					</span>
				</div>
				<!--/*******操作*******/-->
				<form th:action="@{/admin/m/base/tag/list.gsp}" method="get">
					<div class="layui-form-item">
						<blockquote class="layui-elem-quote layui-quote-nm">
							<div class="layui-inline">
								<div class="layui-input-inline">
									<a th:href="@{/admin/m/base/tag/add.gsp}" class="layui-btn"><i class="layui-icon">&#xe61f;</i> 新增</a>
								</div>
							</div>
							<div class="layui-inline" style="float: right;">
								<div class="layui-input-inline" style="width: 200px;">
									<input type="search" id="simpleQueryParam" name="simpleQueryParam" placeholder="关键字" autocomplete="off" class="layui-input">
								</div>
								<button class="layui-btn" lay-submit="" lay-filter="searchForm">
									<i class="layui-icon">&#xe615;</i>
								</button>
							</div>
						</blockquote>
					</div>
				</form>
				<!--/***** 列表 *****/-->
				<table class="layui-table" lay-even="" lay-skin="row">
					<thead id="dataTable">
						<tr>
							<th style="width: 40px">#</th>
							<th>Tag名称</th>
							<th>创建日期</th>
							<th>文档数量</th>
							<th style="width: 140px">操作</th>
						</tr>
					</thead>
					<tbody>
						<tr th:if="${tagList.records == null or tagList.records.size() == 0}">
							<td colspan="5" style="text-align: center;">暂时没有数据</td>
						</tr>
						<tr th:each="item,items:${tagList.records}">
							<td th:text="${tagList.pageSize*(tagList.page-1)+items.index+1}" style="text-align: center;">序号</td>
							<td th:text="${item.tagName}">Tag名称</td>
							<td th:text="${item.createDataTime!=null?#dates.format(item.createDataTime,'yyyy-MM-dd HH:mm:ss'):''}">创建日期</td>
							<td th:text="${item.refers}">文档数量</td>
							<td style="text-align: center;"><a class="layui-btn layui-btn-small" th:href="@{/admin/m/base/tag/edit_{id}.gsp(id=${item.id})}"><i class="layui-icon">&#xe642;</i></a>
								<button class="layui-btn layui-btn-small layui-btn-normal" th:onclick="|deleted('${item.id}')|">
									<i class="layui-icon">&#xe640;</i>
								</button></td>
						</tr>
					</tbody>
				</table>
				<div id="pageDiv"></div>
			</div>
		</div>
		<div th:replace="fragments/footer_admin">底部版权信息等</div>
	</div>
</body>
<div th:replace="fragments/import_js_admin">引入js</div>
<!--/***** 当前页js start *****/-->
<script th:inline="javascript">
    /*<![CDATA[*/
    var $ = layui.jquery;
    var result = /*[[${tagList}]]*/;
    $(function(){
        $("#simpleQueryParam").val(GetQueryString("simpleQueryParam"));
        var option = {
            listUrl : /*[[@{/admin/m/base/tag/list.gsp?}]]*/,
            totalPages : result.totalPages,
            page : result.page,
            param : {
                simpleQueryParam
            }
        };
        tg_basePage(option);
    })

    var deleteUrl = /*[[@{/admin/m/base/tag/delete_{id}.htm}]]*/;
    function deleted(id) {
        tg_deleteItem(deleteUrl.replace('{id}',id), function(){
            location.reload();
        });
    }
    /*]]>*/
</script>
<!--/***** 当前页js end *****/-->
</html>